﻿<UserControl x:Class="FeedNews.Views.SearchRSSView"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="{Binding ViewHeight}" d:DesignWidth="{Binding ViewWidth}">
    <Grid >
            <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{Binding CategoryColWidth}"/>
            <ColumnDefinition Width="{Binding CategoryListColWidth}"/>
        </Grid.ColumnDefinitions>
            <Grid Grid.Column="0" Background="#FF101010">
            <Viewbox StretchDirection="Both" Stretch="Uniform">
                <DockPanel>
                    <ItemsControl ItemsSource="{Binding MyCategory}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Vertical" />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Button 
                                    Style="{DynamicResource IconButtonStyle}"
                                    BorderBrush="Transparent"
                                    Foreground="DeepSkyBlue"
                                    Content="{Binding Category}"
                                    Command="{Binding GetList}">
                                    <Button.Background>
                                        <SolidColorBrush Color="Gray" Opacity="0.0" />
                                    </Button.Background>
                                </Button>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </DockPanel>
            </Viewbox>
        </Grid>
            <Grid Grid.Column="1" Background="#FF151515">
                <DockPanel>
                    <ItemsControl ItemsSource="{Binding MyData,Mode=TwoWay}">
                        <ItemsControl.ItemsPanel>
                            <ItemsPanelTemplate>
                                <StackPanel Orientation="Vertical" />
                            </ItemsPanelTemplate>
                        </ItemsControl.ItemsPanel>
                        <ItemsControl.ItemTemplate>
                            <DataTemplate>
                                <Grid Height="{Binding CategoryListEntryHeight}">
                                    <Grid.ColumnDefinitions>
                                        <ColumnDefinition Width="{Binding CategoryListEntrylogoWidth}"/>
                                        <ColumnDefinition Width="{Binding CategoryListEntryNameWidth}"/>
                                        <ColumnDefinition Width="{Binding CategoryListEntryButtonWidth}"/>
                                    </Grid.ColumnDefinitions>
                                    <Grid Grid.Column="0" >
                                        <Image Source="{Binding Logo}" Margin="3,0,0,0"/>
                                    </Grid>
                                    <Grid Grid.Column="1" Margin="5">
                                        <TextBlock Text="{Binding Name}" FontSize="14" Foreground="White" VerticalAlignment="Center"/>
                                        <TextBlock Text="{Binding Description}"/>
                                    </Grid>
                                    <Grid Grid.Column="2">
                                        <Button Style="{StaticResource IconButtonStyle}"
                                                Command="{Binding AddItem}">
                                            <Image Source="/Icon/plus.png" />
                                        </Button>
                                    </Grid>
                                </Grid>
                            </DataTemplate>
                        </ItemsControl.ItemTemplate>
                    </ItemsControl>
                </DockPanel>
        </Grid>
    </Grid>
</UserControl>
